#include "basic.h"
#include "gdt.h"
#include "idt.h"
#include "io.h"
#include "irq.h"
#include "multiboot.h"
#include "pmm.h"
#include "serial.h"
#include <stdbool.h>
#include <stdint.h>

// @todo: higher half
// @todo: Clean out some notes?

void kmain(uint32_t magic, multiboot_info_t *mboot) {
	
	enable_serial();
	
	// @fix panic
	assert(magic == MULTIBOOT_BOOTLOADER_MAGIC);
	
	install_gdt();
	install_idt();
	install_irqs();
	init_pmm(mboot);
	
	asm volatile("sti");

	printf("Entering loop...\n");

	while (true) {
		asm volatile("hlt");
	}

}
